import unittest

from framework.output.buffered_output import BufferedOutput
from framework.output.file_output import FileOutput
from framework.core.crawler_result import Result


class BufferedOutputTestCase(unittest.TestCase):
    def test_something(self):
        results = list()
        for i in range(80):
            results.append(Result.create("www.baidu.com", Key1=str(i), Key2="b"))
        output = BufferedOutput(FileOutput("D:/pt_spider_outputs2", loop_through=False), 30)
        output.dump(results)



if __name__ == '__main__':
    unittest.main()
